const { override, addWebpackPlugin, addWebpackAlias } = require('customize-cra')
const JiessBase = require('@jiess/utils/webpack');
const { JiessResolver } = require('@jiess/utils/resolver');
const AutoImport = require('unplugin-auto-import/webpack').default;
const path = require('path');
module.exports = override(
	addWebpackAlias({
		['@']: path.resolve(__dirname, 'src')
	}),
	addWebpackPlugin(
		new JiessBase({
			env: 'react16.8'
		})
	),
	addWebpackPlugin(
		AutoImport({
			resolvers: [JiessResolver()],
			eslintrc: {
				enabled: true, // Default `false`
				filepath: './.eslintrc-auto-import.json', // Default `./.eslintrc-auto-import.json`
				globalsPropValue: true, // Default `true`, (true | false | 'readonly' | 'readable' | 'writable' | 'writeable')
			},
		}),
	)
)